package com.zhengtoudai.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * Created by Administrator on 2016/8/23 0023.
 */

public class Test {
    public static void main(String[] str){

        Calendar calendar=Calendar.getInstance();
        calendar.setTimeInMillis(1000);
        DateFormat format=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        format.format(calendar.getTime());
        System.out.println(format.format(calendar.getTime()));
        calendar.get(Calendar.YEAR);
        System.out.print(calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)+"月"+calendar.get(Calendar.DAY_OF_MONTH)
        +"日"+calendar.get(Calendar.HOUR_OF_DAY)+"时"+calendar.get(Calendar.MINUTE)+"分"+calendar.get(Calendar.SECOND)+"秒");
    }
    public static void sort(int[] arr){
        for (int i = 0; i <arr.length ; i++) {
            for (int j = i; j <arr.length-1 ; j++) {
                if (arr[i]<arr[j+1]){
                    int k=arr[i];
                    arr[i]=arr[j+1];
                    arr[j+1]=k;
                }
            }
        }
    }


}
